const { Tab } = require('../../assets/libs/zanui/index');

var app = getApp();
Page(Object.assign({}, Tab, {
  data: {
	cdnUrl: '',
    bannerList: [],
    archivesList: [],
    loading: false,
    nodata: false,
    nomore: false,
    tab: {
      list: [],
      selectedId: '0',
      scroll: true,
      height: 44
    },
		/* 自定义导航栏参数 */
		loading: false,
		color: '#FFFFFF',
		background: '#FFFFFF',
		show: true,
		animated: false,
		back: true,
		title: "地址管理",
		
		addressList: []
  },
  onLoad: function () {
    var that = this;
		that.setData({
			cdnUrl: app.cdnUrl,
		});
  },
	onShow: function (){
		this.addressList();
	},
  onPullDownRefresh: function () {
		this.addressList();
  },
  onReachBottom: function () {},
  addressList: function () {
    var that = this;
    app.request('/addons/cms/wxapp.user/addressList', {}, function (data, ret) {
      that.setData({
        addressList: data,
      });
    }, function (data, ret) {
      app.error(ret.msg);
    });
  },
  onShareAppMessage: function () {
    return {
      title: '',
      desc: '',
      path: '/page/index/index'
    }
  }
}))
